home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 August (Alt) / CHIP 2005-08.1.iso / program / guvenlik / syslinux-3.07.exe / dos / string.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-12-15  |  533 b   |  24 lines

  1. /*
  2.  * string.h
  3.  */
  4.  
  5. #ifndef _STRING_H
  6. #define _STRING_H
  7.  
  8. /* Standard routines */
  9. #define memcpy(a,b,c)    __builtin_memcpy(a,b,c)
  10. #define memset(a,b,c)    __builtin_memset(a,b,c)
  11. #define strcpy(a,b)    __builtin_strcpy(a,b)
  12. #define strlen(a)    __builtin_strlen(a)
  13.  
  14. /* This only returns true or false */
  15. static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n)
  16. {
  17.   _Bool rv;
  18.   asm volatile("cld ; repe ; cmpsb ; setne %0"
  19.            : "=abd" (rv), "+D" (__m1), "+S" (__m2), "+c" (__n));
  20.   return rv;
  21. }
  22.  
  23. #endif /* _STRING_H */
  24.